package mvp.levelup.spring.detectors;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * Created by Valera on 25.08.2014.
 */
@Component
public class FireDetector implements IDetector {
    @Autowired
    private FireAnalyzer fireAnalyzer;

    @Override
    public boolean isOk() {
        int co2 = fireAnalyzer.getCO2();
        int temp = fireAnalyzer.getCurrentTemperature();
        return co2 < 30 && temp < 40;
    }

    @Override
    public List<String> getReport() {
        return Arrays.asList("OK", "OK", "OK");
    }
}
